PowerSNMP for ActiveX
Visual C++ Notes

Each development environment has it's own unique way of supporting ActiveX controls. Visual Basic, for example, offers superb support for using controls both on forms (by adding it to the component bar and dragging it onto a form) and off forms (by instantiating them at run-time using "Dim" and "Set" constructs). In Visual C++ it is a little harder, and there are different techniques possible using MFC and "straight" WIN32.

MFC Support for ActiveX

MFC provides direct support for placing a control on a form. Using the ClassWizard, you then reference the control ID, add a variable, and then add event handles for each event. This mechanism works well with Dart PowerSNMP controls, but has the following shortcomings that require a workaround:

  1. When you insert a control, the resource file caches license information. When you use the control as a trial and subsequently purchases a license, you must manually remove the control and then re-add it so that the license information is properly included and passes the license check at run time.

  2. You cannot use this technique for non-MFC or formless applications, such as console applications, service applications, ATL controls, "straight" WIN32 applications, and other C++ environments (such as Borland C++ and C++ Builder).

Class Support for ActiveX

Use the ClassFactory class to create an instance of a licensed control.


PowerSNMP for ActiveX Documentation Version 4.0
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic